@isTest
public class Test_ConvertToStudentAccount {
public static testMethod void testConvertToStudentAccount (){
//test.starttest();
PageReference pageRef = Page.ConvertToStudentAccount ;
Test.setCurrentPage(pageRef);

Lead l=new Lead();
//List<Lead> lstLead=[Select id,firstname,lastname,email,isconverted from Lead where firstname!=null and lastname!=null and email!=null and isconverted=false order by createddate desc Limit 1];
l.email='john@john.com';
l.firstname='John';
l.HasOptedOutOfEmail=false;
l.lastname='Coppedge';
//l.Mail_Opt_Out__c=false;
l.Personal_Email__c='john@john.com';
l.status='Appointment';
l.phone='(801) 555-5556';
DateTime birthDate= DateTime.now(); //DateTime variable
String birthDate_Formatted_Date = birthDate.format('yyyy-MM-dd');
l.Birth_Date__c=date.valueof(birthDate_Formatted_Date);
l.Work_Phone__c='(801) 555-5556';
l.Country = 'Mexico';

insert l;



Lead l1=new Lead();
//List<Lead> lstLead=[Select id,firstname,lastname,email,isconverted from Lead where firstname!=null and lastname!=null and email!=null and isconverted=false order by createddate desc Limit 1];
l1.email='john@john.com';
l1.firstname='John';
l1.HasOptedOutOfEmail=false;
l1.lastname='Coppedge';
//l1.Mail_Opt_Out__c=false;
//l.Personal_Email__c='john@john.com';
l1.status='Appointment';
l1.phone='(801) 555-5556';
//l.Birth_Date__c=System.today();
l1.Work_Phone__c='(801) 555-5556';
l1.Country = 'Mexico';
insert l1;

test.starttest();


if(l.id!=null)
{
//ApexPages.currentPage().getParameters().put('LeadId',lstLead[0].id);

ApexPages.currentPage().getParameters().put('leadId',l.id);
ApexPages.StandardController controller;
ConvertToStudentAccount  lcp=new ConvertToStudentAccount(controller);
lcp.convertLead();

}

if(l1.id!=null)
{
//ApexPages.currentPage().getParameters().put('LeadId',lstLead[0].id);

ApexPages.currentPage().getParameters().put('leadId',l1.id);
ApexPages.StandardController controller;
ConvertToStudentAccount  lcp=new ConvertToStudentAccount(controller);
lcp.convertLead();

}
test.stoptest();





}

}